﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyAttribute.ModelValidate
{
    [AttributeUsage(AttributeTargets.Property)]
    public class CustomRequiredAttribute : AbstractValidateAttribute
    {
        //public string ErrorMessage = "验证失败";

        public CustomRequiredAttribute()
        { }

        /// <summary>
        /// 验证的行为
        /// </summary>
        /// <param name="oValue"></param>
        /// <returns></returns>
        public override bool Validate(object oValue)
        {
            //if (oValue != null)
            //{
            //    return true;
            //}
            //else
            //{
            //    return false;
            //}

            return oValue != null;
        }


    }
}
